﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ADC.BL;

namespace ADC.Web
{
    public partial class Project : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                BindData();
            }

        }

        private void BindData()
        {
            //Get parameter
            var projectTypeID = Request.Params["ID"];
            if (projectTypeID == null) return;
            try
            {
                var proID = Convert.ToInt32(projectTypeID);
                List<DAL.Project> projects = ProjectFactory.ListAllByProjectType(proID);
                ListViewProject.DataSource = projects;
                ListViewProject.DataBind();
            }
            catch (Exception)
            {

                return;
            }
            
        }

    }
}